<template>
	<view class="wrap">
		<view class="search">
			<u-search v-model="query.keywords" @custom="search" @search="search" height="80" placeholder="请输入姓名/学号/学院名"></u-search>
			<u-row gutter="16" style="margin-top: 10rpx;margin-bottom: 20rpx;">
				<u-col span="5.5">
					<u-input v-model="query.minTalkCnt" type="input" :border="true" placeholder="谈话次数最小值"/>
				</u-col>
				<u-col span="1">
					-
				</u-col>
				<u-col span="5.5">
					<u-input v-model="query.maxTalkCnt" type="input" :border="true" placeholder="谈话次数最大值"/>
				</u-col>
			</u-row>
		</view>
		<scroll-view class="scroll-list" scroll-y="true"  style="width: 100%; height: 87%; margin-top: 5rpx;margin-bottom: 5rpx;" @scrolltolower="loadMore">
			<view class="uni-list" v-for="(item, index) in list" :key="index" style="margin-top: 5rpx;margin-bottom: 5rpx;">
				<u-card :show-head="false">
					<view class="" slot="body">
						<u-cell-group>
							<u-cell-item title="学院" :arrow="false">{{item.deptName}}</u-cell-item>
							<u-cell-item title="姓名" :arrow="false" :value="item.realName"></u-cell-item>
							<u-cell-item title="学号" :arrow="false" :value="item.account"></u-cell-item>
							<u-cell-item title="谈话次数" :arrow="false" :value="item.talkCnt"></u-cell-item>
						</u-cell-group>
					</view>
				</u-card>
			</view>
			<u-loadmore :status="loadStatus" bgColor="#f2f2f2"></u-loadmore>
		</scroll-view>
	</view>
</template>
<script>
	import $time from '@/common/time.js';
	export default {
		data() {
			return {
				query: {
					current: 1,
					size: 10,
					keywords: '',
					minTalkCnt:'',
					maxTalkCnt:''
				},
				list: [],
				pages: 0,
				loadStatus: 'loadmore',
				options: [],
			};
		},
		onLoad(params) {
			this.loadList();
		},
		computed:{
			
		},
		methods: {
			navTo(url) {
				uni.navigateTo({
					url: url
				});
			},
			search(value) {
				this.list = [];
				this.query.current = 0;
				this.loadList();
			},
			loadList() {
				this.$u.api.mis.misAssistantUserExt.list(this.query).then(res => {
					if (!res.data.records || res.data.records.length == 0) {
						this.loadStatus = "nomore";
						return;
					}
					res.data.records.forEach((item) => {
						item.show=false;
					})
					this.list = this.list.concat(res.data.records);
					this.pages = res.pages;
					this.query.current = res.data.current;
					this.query.size = res.data.size;
					this.loadStatus = "loadmore";
				});
			},
			loadMore() {
				this.loadStatus = "loading";
				setTimeout(() => {
					this.query.current += 1;
					this.loadList();
				}, 100);
			},
		}
	};

</script>
<style lang="scss">
@import '../../../../common/uni.css';
page {
	background-color: #f5f5f5;
}
.wrap {
	display: flex;
	flex-direction: column;
	height: calc(100vh - var(--window-top) - var(--window-bottom)); // 视高 - 内容区顶部 - 内容区底部
	width: 100%;
}
.search{
	height:100px;
	background-color: #ffffff;
	// background-image: url(/static/aidex/school_bg.jpg);
	background-size: 450px;
}
.uni-title{
	font-size: 30rpx;
	color: #333333;
	padding: 10px;
	background: #fff;
	border-top:1px solid #ededed;
	margin-top: 20rpx;
}
.uni-media-list {
    padding: 15px 15px;

}
.uni-media-list-body {
    height: 60px;
	padding-left:20rpx;
	border-left:thick double #D5D5D5;
	border-width: 1px;
}
.uni-media-list-text-top{
	width: 100%;
	line-height: 35rpx;
	font-size: 28rpx;
	span{
		margin-right: 10rpx;
	}
}
.uni-media-list-text-content {
    width: 100%;
    line-height: 35rpx;
    font-size: 22rpx;
	color: darkgray;
	span{
		margin-right: 10rpx;
	}
}
.uni-media-list-text-bottom {
    width: 100%;
    line-height: 24rpx;
    font-size: 26rpx;
	color: #666666;
	text-align: right;
	span{
		margin-right: 10rpx;
	}
}
.uni-media-list-right {
    height: 60px;
	padding-left:20rpx;
	transform: translateY(40%) translateX(50%)
}
.btn-plus {
		position: absolute;
		bottom: 50rpx;
		right: 50rpx;
		z-index: 1;
		opacity: 0.6;
	}

.btn-plus:hover {
	opacity: 1;
}


</style>